package com.xiaochong.tir.common.util;

/**
 *  返回code
 * Created by cx on 2018/4/25.
 */
public enum ApiResultCodeUtils {

    BASE_SUCCESS("1000", "成功"),
    //SYSTEM_NO_DATA("2000", "无数据"),
    SYSTEM_ERROR("5000","系统错误"),
    SYSTEM_NULL("2000","未查询到结果"),
    PARAMS_ERROR("3000","参数错误"),
    TOKEN_ERROR("100008","token不存在或者过期");


    public static String getMsgByCode(String code) {
        for (ApiResultCodeUtils managerConstans : ApiResultCodeUtils.values()) {
            if (managerConstans.getCode().equals(code)) {
                return managerConstans.getMsg();
            }
        }

        return "";
    }

    private ApiResultCodeUtils(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    private String code;
    private String msg;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    }
